#pragma once
#include <string>
#include <map>
#include "FlowConfig.h"
#include "TalkFlow.h"
#include "TinyMsg.h"

using namespace TinyCC::msg;

namespace IVRFlow{
class CFlowPool
{
public:
	CFlowPool(void);
	~CFlowPool(void);
private:
	std::map<std::string,IVRFlow::CFlowConfig*> m_flowConfigs;
	std::map<std::string,CTalkFlow*> m_flows;
public:
	bool StartFlow(std::string callerID, std::string calledID, std::string talkID ="");
	void ProcessReceivedMsg(CTinyMsg& inMsg,CTinyMsg& OutMsg);
public:
	CTalkFlow* getFlowByTalkID(std::string talkID);
	CTalkFlow* getNewFlow(std::string talkID);
};

}